Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for znode flag #19

Merged

Conversation

zircote
Copy link
Contributor

@zircote zircote commented Feb 22, 2017

This allows for the aurora scheduler znode to be passed as
a flag at runtime. We rely on zk for multiple clusters and to enable this to work for us
it become necessary to allow us to direct the scraper to the correct znode. Let me know
your feedback on the pr looking forward to hearing back.

This allows for the aurora scheduler znode to be passed as
a flag at runtime.
finder.go Outdated
zkLeaderPrefix = "singleton_candidate_"
)

type finder interface {
leaderURL() (string, error)
}

func newFinder(url string) (f finder, err error) {
func newFinder(url string, znode string) (f finder, err error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you only need to specify the type once: url, znode string

finder.go Outdated
@@ -86,7 +85,7 @@ type zkFinder struct {
leaderIP string
}

func newZkFinder(url string) *zkFinder {
func newZkFinder(url string, znode string) *zkFinder {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

main.go Outdated
@@ -21,6 +21,7 @@ var (
addr = flag.String("web.listen-address", ":9113", "Address to listen on for web interface and telemetry.")
auroraURL = flag.String("exporter.aurora-url", "http://127.0.0.1:8081", "URL to an Aurora scheduler or ZooKeeper ensemble")
metricPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.")
zkPath = flag.String("zk.path", "/aurora/scheduler", "zkNode that aurora matains master election.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/matains/maintains/g

finder.go Outdated
@@ -15,21 +15,20 @@ import (
)

const (
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the parentheses

@tommyulfsparre
Copy link
Owner

@zircote thanks! just a few nits.

Also, as of Aurora 0.16.0 curator will be the default ZooKeeper client and this will no longer work for detecting the scheduler.

spelling and formatting corrections
@zircote
Copy link
Contributor Author

zircote commented Feb 23, 2017

@tommyulfsparre do you have any preferences regarding how best to resolve this? Do you want to support <0.16.0 or just update it to support >=0.16.0?

@tommyulfsparre
Copy link
Owner

@zircote so I think of not adding curator support for now and later support both, toggled with a cmdline flag.

@tommyulfsparre tommyulfsparre merged commit 0346821 into tommyulfsparre:master Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants